﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class GroseController : MonoBehaviour
{
    private Transform groseTrans;
    private void Start()
    {
        groseTrans = GameObject.Find("Grose").GetComponent<Transform>();      
    }

    private void Update()
    {
        GroseControl();
    }


    private void GroseControl()
    {
        if (Input.GetKey(KeyCode.W))
        {
            groseTrans.Translate(Vector3.up*2*Time.deltaTime);
            groseTrans.position = new Vector3(groseTrans.position.x,Mathf.Clamp(groseTrans.position.y,-3.5f,3.5f),groseTrans.position.z);
        }
        if (Input.GetKey(KeyCode.S))
        {
            groseTrans.Translate(Vector3.down*2*Time.deltaTime);
            groseTrans.position = new Vector3(groseTrans.position.x, Mathf.Clamp(groseTrans.position.y, -3.5f, 3.5f), groseTrans.position.z);
        }

    }
}
